-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New tool to serialize mata test cases to file. #9441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
* Scaffolding for new appdistribution MCP tool. * Refactor business logic out of the appdistribution CLI so that it can be used by an MCP tool. * Wire new appdistribution tool up to the business logic. * Fix linting errors. * Update src/appdistribution/distribution.ts Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: Jamie Rothfeder <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
* Rename appdistribution directory to apptesting * Make variables consistent with directory rename. --------- Co-authored-by: Jamie Rothfeder <[email protected]>
…9280) * Use a datastructure to represent test devices rather than a string. * Update src/mcp/tools/apptesting/tests.ts Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update src/mcp/tools/apptesting/tests.ts Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Pretty --------- Co-authored-by: Jamie Rothfeder <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
* Add initial MCP prompt for running automated tests * Fix typos
* Create a on-off test and execute. * Can now create a on-off test. * Update src/appdistribution/client.ts Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update src/mcp/tools/apptesting/tests.ts Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * PR feedback * Separate test check in to a different tool so that gemini can orchestrate running and checking for completion. * Set the devices field to optional --------- Co-authored-by: Jamie Rothfeder <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
… description (#9322) * Use the same default device that's used in the Console * Update prompt to support generating a test case when there is no test description passed
* Add custom auto-enablement for app testing * Address gemini code assist comments * Fix intersection bug * Fix issues with test
Co-authored-by: Jamie Rothfeder <[email protected]>
Summary of ChangesHello @jrothfeder, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Firebase App Distribution functionality by integrating support for AI-guided testing. It introduces new data structures and client methods to handle AI instructions for tests, refactors core distribution logic into more manageable units, and provides a suite of new prompts and tools for users to define, run, and monitor these advanced automated tests. The changes aim to streamline the process of creating reliable and repeatable test cases for mobile applications. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a new tool for serializing MATA test cases and adds functionality for AI-guided testing. The changes include significant refactoring of the app distribution logic, extracting common functionalities like upload and awaitTestResults into a shared distribution.ts module. This improves code structure and reusability. New MCP prompts and tools for app testing are added, gated by an experiment flag. The overall changes are well-structured and the refactoring is a good improvement. I've left a couple of minor suggestions to improve code clarity and fix some typos in a prompt.
| if (releaseTestNames.size === 0) { | ||
| utils.logSuccess("Automated test(s) passed!"); | ||
| return; | ||
| } else { | ||
| continue; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The else { continue; } block is redundant. The for...of loop will naturally continue to the next iteration if the preceding if condition is not met. Removing this else block will make the code slightly cleaner.
if (releaseTestNames.size === 0) {
utils.logSuccess("Automated test(s) passed!");
return;
}| You should already know the value of \`appId\' and \`projectId\` from earlier (if you only know \`projectNumber\', | ||
| use the \`firebase_get_project\` tool to get \`projectId\`). \`packageName\` is the package name of the app we tested. | ||
| The \`apptesting_run_test\` tool returns a response with field \`name\` in the form | ||
| projects/{projectNumber}/apps/{appId}/releases/{releaseId}/tests/{releaseTestId}. Extract the values for \'releaseId\' | ||
| and \`releaseTestId\` and use provide a link to the results in the Firebase Console in the format: | ||
| \`https://console.firebase.google.com/u/0/project/{projectId}/apptesting/app/android:{packageName}/releases/{releaseId}/tests/{releaseTestId}\`. | ||
| You can check the status of the test using the \`apptesting_check_status\` tool with \`release_test_name\' set to | ||
| the name of the release test returned by the \`run_test\` tool. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a few typos in this part of the prompt text. There are stray single quotes or incorrect backticks around appId, releaseId, and release_test_name. These should be corrected to ensure the prompt is parsed correctly by the language model.
| You should already know the value of \`appId\' and \`projectId\` from earlier (if you only know \`projectNumber\', | |
| use the \`firebase_get_project\` tool to get \`projectId\`). \`packageName\` is the package name of the app we tested. | |
| The \`apptesting_run_test\` tool returns a response with field \`name\` in the form | |
| projects/{projectNumber}/apps/{appId}/releases/{releaseId}/tests/{releaseTestId}. Extract the values for \'releaseId\' | |
| and \`releaseTestId\` and use provide a link to the results in the Firebase Console in the format: | |
| \`https://console.firebase.google.com/u/0/project/{projectId}/apptesting/app/android:{packageName}/releases/{releaseId}/tests/{releaseTestId}\`. | |
| You can check the status of the test using the \`apptesting_check_status\` tool with \`release_test_name\' set to | |
| the name of the release test returned by the \`run_test\` tool. | |
| You should already know the value of \`appId\` and \`projectId\` from earlier (if you only know \`projectNumber\`, | |
| use the \`firebase_get_project\` tool to get \`projectId\`). \`packageName\` is the package name of the app we tested. | |
| The \`apptesting_run_test\` tool returns a response with field \`name\` in the form | |
| projects/{projectNumber}/apps/{appId}/releases/{releaseId}/tests/{releaseTestId}. Extract the values for \`releaseId\` | |
| and \`releaseTestId\` and use provide a link to the results in the Firebase Console in the format: | |
| \`https://console.firebase.google.com/u/0/project/{projectId}/apptesting/app/android:{packageName}/releases/{releaseId}/tests/{releaseTestId}\`. | |
| You can check the status of the test using the \`apptesting_check_status\` tool with \`release_test_name\` set to | |
| the name of the release test returned by the \`run_test\` tool. |
| ); | ||
|
|
||
| <<<<<<< HEAD | ||
| export const testcase_export = tool( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if we want to create a new tool for this. In general, the CLI team is trying to reduce the number of tools in the Firebase MCP server, which is why I ended up combining the check_tests and get_devices tools in the previous PR.
No description provided.